// 知识接口
import config from "./config";

var domain = config.getDomain;

var pageCount = config.getPageCount;

var DUIXIN_API =  domain + '/index.php?v=1&appid='+config.getAPPID+'&appsecret='+config.getAPPSECRET+'&';

export default  {
	//发布九格图id
	getFabuid(){
		var url = DUIXIN_API + '&s=zhishi&c=fabu&m=fabuid';
		return url;
	},
	//导航
	getZhishi_daohang(code,uid) {
		var url = DUIXIN_API + 's=zhishi&c=daohang&m=index';
		return url;
	},
	// 发布小知识
	postShenqing_zhishi(uid,code,id) {
		var url = DUIXIN_API + '&s=member&app=zhishi&c=home&m=add&api_auth_uid='+uid+'&api_auth_code='+code+'&catid='+id;
		return url;
	},
	//发布帖子
	postTiezi(uid,code,cid) {
		var url = DUIXIN_API + '&s=member&app=quan&c=quantie&m=add&api_auth_uid='+uid+'&api_auth_code='+code+'&cid='+cid;
		return url;
	},
	//上传图片多张
	postTupians(uid,code) {
		return DUIXIN_API+'s=api&c=file&m=upload&api_auth_uid='+uid+'&api_auth_code='+code+'&siteid=1';
	},
	
	// 知识详情
	getZhishi_detail(id){
		var url = DUIXIN_API + '&s=zhishi&c=zhishi&m=detail&id='+id;
		return url;
	},
	// 申请的知识数量 shenhe_zhishi_shu
	getZhishi_shu(uid,code){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=shenhe&m=shenhe_zhishi_shu&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	// 知识页面信息
	getZhishi(uid,code){
		var url = DUIXIN_API + '&s=zhishi&c=zhishi&m=index';
		if(uid || code){
			url += '&api_auth_uid='+uid+'&api_auth_code='+code;
		}
		return url;

	},
	// 列表
	getTiezi_list(obj) {
		var url = DUIXIN_API + '&s=zhishi&c=zhishiliebiao&m=index&pagesize=' + pageCount + '&page=' + obj.page;
		if (obj.categories!= 0) {
		  url += '&catid=' + obj.categories;
		}
		return url;
	},
	// 课程内容
	getKe() {
		var url = DUIXIN_API + '&s=zhishi&c=ke&m=index';
		return url;
	},
	// 收藏判断
	getShoucang_panduan(uid,code) {
		if(uid=='' || code==''){
			var url = DUIXIN_API + '&s=zhishi&c=shoucang&m=shoucang_panduan';
		} else {
			var url = DUIXIN_API + '&s=member&app=zhishi&c=shoucang&m=shoucang_panduan&api_auth_uid='+uid+'&api_auth_code='+code;
		}
		return url;
	},
	
	// 点击收藏
	postShoucang(uid,code) {
		var url = DUIXIN_API + '&s=member&app=zhishi&c=shoucang&m=index&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	// 点赞判断
	getDianzan_panduan(uid,code) {
		if(uid=='' || code==''){
			var url = DUIXIN_API + '&s=zhishi&c=dianzan&m=dianzan_panduan';
		} else {
			var url = DUIXIN_API + '&s=member&app=zhishi&c=dianzan&m=dianzan_panduan&api_auth_uid='+uid+'&api_auth_code='+code;
		}
		
		return url;
	},
	// 点赞
	postDianzan(uid,code) {
		var url = DUIXIN_API + '&s=member&app=zhishi&c=dianzan&m=index&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	// 点赞头像
	getDianzan_touxiang() {
		var url = DUIXIN_API + '&s=zhishi&c=dianzan&m=dianzan_touxiang';
		return url;
	},
	//评论内容展示+帖子内容展示
	getPinglunNeirong (tieid,uid,code) {
		return DUIXIN_API+'s=zhishi&c=kecheng_comment&id='+tieid+'&api_auth_code='+code+'&api_auth_uid='+uid;
	},
	// 提交评论
	postPinglun (tieid,uid,code,rid) {
		return DUIXIN_API+'s=zhishi&c=kecheng_comment&m=post&id='+tieid+'&api_auth_code='+code+'&api_auth_uid='+uid+'&rid='+rid;
	},
	// 审核通过
	getShenhe_tong(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=shenhe&m=tong&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 审核拒绝
	getShenhe_jujue(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=shenhe&m=jujue&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	// 隐藏帖子
	getYincang(uid,code){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=edit&m=yincang&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	//删除帖子
	getDel_tie(uid,code){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=edit&m=del&api_auth_uid='+uid+'&api_auth_code='+code;
		return url;
	},
	//修改帖子
	getEdit_tie(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=zhishi&c=edit&m=edit&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},
	//购买扣除费用
	postGoumai(uid,code,id){
		var url = DUIXIN_API + '&s=member&app=zhishi&m=index&c=goumai&api_auth_uid='+uid+'&api_auth_code='+code+'&id='+id;
		return url;
	},

	

	


	
	
};